import request from '@/utils/request';
import qs from 'qs';
//用户登录
export function login(params) {
  return request({
    url: '/api/login',
    method: 'post',
    data: qs.stringify(params)
  });
}

export function current(params) {
  return request({
    url: `/api/users/current`
  });
}

export function logout() {
  return request({
    url: '/api/logout',
    method: 'post'
  });
}

export function online() {
  return request({
    url: '/api/online',
    method: 'get'
  });
}

export function lock() {
  return request({
    url: '/api/users/lock',
    method: 'post'
  });
}

export function unlock(params) {
  return request({
    url: '/api/users/unlock',
    method: 'post',
    data: qs.stringify(params)
  });
}
